package pers.archives.auth.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pers.archives.auth.mapper.RoleMapper;
import pers.archives.auth.service.RoleService;
import pers.archives.common.entity.Role;
import pers.archives.common.utils.UUIDUtil;

/*
 *@program:archives-parent
 *@author: 赵浩浩
 *@Time: 2020/9/30  16:07
 */
@Service
public class RoleServiceImpl implements RoleService {

    private final UUIDUtil uuidUtil;

    private final RoleMapper roleMapper;

    @Autowired
    public RoleServiceImpl(UUIDUtil uuidUtil, RoleMapper roleMapper) {
        this.uuidUtil = uuidUtil;
        this.roleMapper = roleMapper;
    }

    @Override
    public int addRole(Role role) {
        role = new Role(uuidUtil.nextId(), "测试角色", "测试添加角色");
        return roleMapper.addRole(role);
    }
}
